package problems.multiplexer;

import ec.FitnessEvaluator;
import ec.Solution;
import ge.GESolution;
import ge.ProductionRule;
import problems.Problem;

public class MultiplexerProblem extends Problem {
	public static void main(String[] args) {
		int num_runs = 30;
		int num_gens = 200;
		int pop_size = 500;

		ProductionRule.MAX_DEPTH = 8;
		Problem problem = new MultiplexerProblem();
		String pth = "data/multiplexer6/gens=" + num_gens + "_pop=" + pop_size
				+ "/";

		problem.ec(pth, 27, num_gens, pop_size, 7, 25, 75, 5, true);
		//problem.randomSearch(pth, num_runs, num_gens, pop_size);

	}

	@Override
	protected Solution createRandomSolution() {
		return new GESolution(50 + (int) (Math.random() * 150), 8, .001);
	}

	@Override
	public FitnessEvaluator getFitnessEvaluator() {
		return new MultiplexerFitnessEvaluator(2,
				"src/problems/multiplexer/grammar6.txt");
	}
}
